<!--
 * @Author: “ChengNan” 1429323234@qq.com
 * @Date: 2024-06-07 15:40:21
 * @LastEditors: “ChengNan” 1429323234@qq.com
 * @LastEditTime: 2024-06-12 14:23:12
 * @FilePath: /src/views/7.routerDO/children/child4.vue
 * @Description: 
-->
<template>
  <div>
    <h2>router-view实现切换页面</h2>
    <div>
      <router-link 
        v-for="(item, index) in list" 
        :key="index" 
        :to="item.path">
        {{ item.name }}
      </router-link>
      <hr>
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [
        { name: '总览', path: '/child4/child4_1' },
        { name: '安全', path: '/child4/child4_2' },
        { name: '信息', path: '/child4/child4_3' },
      ]
    }
  },
  methods: {
    toPath(item) {
      this.$router.push({ path: item.path })
    }
  },
}
</script>

<style lang="scss" scoped>

</style>